package com.p04.homework.bean;

/**
 * 电视类
 */
public class Television {
    /**
     * 频道
     */
    private int channel;
    /**
     * 音量
     */
    private int volume;


    //构造器
    public Television() {
    }

    public Television(int channel, int volume) {
        this.channel = channel;
        this.volume = volume;
    }

    public int getChannel() {
        return channel;
    }

    public void setChannel(int channel) {

        if(channel>=2 && channel<=999){
            this.channel = channel;
        }else{
            System.out.println("Channel的值为2-999之间");
        }

    }

    public int getVolume() {
        return volume;
    }

    public void setVolume(int volume) {

        if(volume>=0 && volume<=10){
            this.volume = volume;
        }else{
            System.out.println("Volume的值为0-10之间");

        }

    }
}
